package com.yonyou.pmclouds.plan.entity;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.measureindex.entity.MeasureIndexHistoryVO;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Getter
@Setter
@Table(name = "pm_plan_prog")
public class PlanProgressVO extends SuperVO {

    private static final long serialVersionUID = 374034009361251737L;

    public static final String PROGRESS="progress";
    public static final String START_DATE="startDate";
    public static final String END_DATE="endDate";
    public static final String LAST_SUBMIT_DATE = "lastSubmitDate";
    public static final String FIRST_SUBMIT_DATE = "firstSubmitDate";

    public static final int SCHEDULE_ITEM_COMPLETE = 100;

    @Id
    @NotNull
    private String pkPlan;
    /**
     * 进度比例
     */
    @NotNull
    private Integer progress;
    /**
     * 实际开始日期
     */
    private Date startDate;
    /**
     * 实际结束日期
     */
    private Date endDate;
    /**
     * 首次填报日期
     */
    private Date firstSubmitDate;
    /**
     * 最后填报日期
     */
    private Date lastSubmitDate;
    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;

    @Transient
    private String description;

    @Transient
    private String pkProject;

    //反馈记录信息
    @Transient
    private MeasureIndexHistoryVO[] measureIndexHistoryVOS;

    @Transient
    private String billType;

    @Transient
    private String[] pictures;

    public static PlanProgressVO convertFromTransVO(PlanProgressTransVO transVO) {
        PlanProgressVO progressVO = new PlanProgressVO();
        progressVO.pkPlan = transVO.getPkPlan();
        progressVO.progress = transVO.getProgress();
        progressVO.startDate = transVO.getStartDate();
        progressVO.endDate = transVO.getEndDate();
        progressVO.creationtime = transVO.getCreationtime();
        progressVO.creator = transVO.getCreator();
        progressVO.modifier = transVO.getCreator();
        progressVO.modifytime = transVO.getModifytime();
        return progressVO;
    }
}
